package cn.kgc.controller;

import cn.kgc.commons.vo.Result;
import cn.kgc.dto.add.SmsSpuAddDTO;
import cn.kgc.service.SmsSpuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p></p>
 *
 * @author 李孟鸠
 * @Date: 2022年12月06日9:34
 * 商品对应的活动相关操作的控制器
 */
@RestController
@RequestMapping("/sms/spu")
@Api(tags = "商品对应的活动相关操作")
@Validated
public class SmsSpuController {

    @Resource
    private SmsSpuService smsSpuService;

    @PostMapping("/save")
    @CrossOrigin
    @ApiOperation(value = "新增商品对应的活动",httpMethod = "POST",response = Result.class,produces = "application/json;charset=UTF-8")
    public boolean saveSmsSpu(@RequestBody SmsSpuAddDTO smsSpuAddDTO){
        return smsSpuService.addSmsSpu(smsSpuAddDTO);
    }
}
